package com.scoring.system.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.scoring.system.mapper.ClassCurriculumMapper;
import com.scoring.system.pojo.ClassCurriculum;
import com.scoring.system.service.ClassCurriculumService;
@Service("classCurriculumService")
public class ClassCurriculumServiceImpl implements ClassCurriculumService {
	
	@Resource
	private ClassCurriculumMapper ccDao;

	@Override
	public int softDelete(int id) {
		return ccDao.softDelete(id);
	}

	@Override
	public int saveClassCurriculum(ClassCurriculum record) {
		return ccDao.insert(record);
	}

	@Override
	public ClassCurriculum getClassCurriculumById(int id) {
		return ccDao.selectByPrimaryKey(id);
	}

	@Override
	public List<ClassCurriculum> listClassCurriculumByClassIdAndTerm(int classId, String term) {
		return ccDao.listByClassIdAndTerm(classId, term);
	}

	@Override
	public int updateClassCurriculum(ClassCurriculum record) {
		return ccDao.updateByPrimaryKey(record);
	}

	@Override
	public ClassCurriculum getClassCurriculumByCourse(int courseId) {
		return ccDao.selectByCourse(courseId);
	}

}
